<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<html>
	<head>
		<link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/back/css/bootstrap.min.css">
		<script src="${pageContext.request.contextPath}/back/js/jquery-3.3.1.js"></script>
		<script src="${pageContext.request.contextPath}/back/js/bootstrap.min.js"></script>
		<link rel="stylesheet" href="${pageContext.request.contextPath }/back/css/btn.css" />
	</head>
	<body style="background-color: #f0f9fd;">
		<div align=center style="font-size:25px">用户管理</div><hr/>
		<table bordercolor='#898E90' align='center' border='3px' cellpadding='10px' cellspacing="0px" width="800px">
			<tr bgcolor='lightblue' align='center'>
				<td>Id</td>
				<td>昵称</td>
				<td>邮箱</td>
				<td>状态</td>
				<td>激活码</td>
				<td>操作</td>
			</tr>
			<c:forEach var="user" items="${requestScope.users}">
				<tr align='center'>
					<td>${user.userId}</td>
					<td>${user.nickname}</td>
					<td>${user.email}</td>
					<td>${user.status}</td>
					<td>${user.code}</td>
					<td>
						<input class="button" onclick="location.href='${pageContext.request.contextPath}/user/updateUserStatus?userId=${user.userId}&pageNum=${pageInfo.pageNum}'" value="修改 &raquo;" />
					</td>
				</tr>
			</c:forEach>
		</table>
		<div align="center">
		<span style="font-size: 25px;margin: 5px">
			当前第${pageInfo.pageNum}页,共${pageInfo.pages}页,总${pageInfo.total}条记录
		</span>
		<nav aria-label="Page navigation">
			<ul class="pagination">
				<li><a href="${pageContext.request.contextPath}/user/selectAllUser?pageNum=1">首页</a></li>
				<li>
					<a href="${pageContext.request.contextPath}/user/selectAllUser?pageNum=${pageInfo.prePage}" aria-label="Previous">
						<span aria-hidden="true">&laquo;</span>
					</a>
				</li>
				<c:forEach items="${pageInfo.navigatepageNums}" var="page_Num">
					<c:if test="${page_Num==pageInfo.pageNum}">
						<li class="active"><a href="${pageContext.request.contextPath}/user/selectAllUser?pageNum=${page_Num}">${page_Num}</a></li>
					</c:if>
					<c:if test="${page_Num!=pageInfo.pageNum}">
						<li><a href="${pageContext.request.contextPath}/user/selectAllUser?pageNum=${page_Num}">${page_Num}</a></li>
					</c:if>
				</c:forEach>
				<li>
					<a href="${pageContext.request.contextPath}/user/selectAllUser?pageNum=${pageInfo.pageNum+1}" aria-label="Next">
						<span aria-hidden="true">&raquo;</span>
					</a>
				</li>
				<li><a href="${pageContext.request.contextPath}/user/selectAllUser?pageNum=${pageInfo.pages}">尾页</a></li>
			</ul>
		</nav>
		</div>
	</body>  
</html>



